#ifndef _MAX_NW_SCHEDULER_H_
#define _MAX_NW_SCHEDULER_H_
#include "NWScheduler.h"
#include "sthread.h"
class MaxNWScheduler:public NWScheduler{
 public:
  MaxNWScheduler(long bytesPerSec_);
  void waitMyTurn(int flowId, float weight, int lenToSend);
  long long signalNextDeadline(long long deadlineMS);

 private:
  // state
  long bytesPerSec;
  long long prevdeadline;
  bool deadlineReached;
  bool deadlineChanged;

  // synch
  smutex_t mutex;
  scond_t waitReached;
  scond_t waitChanged;
};
#endif 
